<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ include file="../../common/common.jsp" %>
<%@ include file="master_pass.jsp" %>
<HTML>
<HEAD>
<title>新建内容过滤</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<base target="_self">
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
var END_POINT="${pageContext.request.contextPath}/buffalo";
var buffalo = new Buffalo(END_POINT);
function doSubmit() {

	form = document.theform;
	
	if(!validateForm(form))
		return;
		
		
    var obj = {};
	obj[Buffalo.BOCLASS] = "com.gouwudai.gobbs.pojo.TbbsContentFilter";
	obj.filterType=parseInt($F('filterType'));
	obj.sourceStr=$F('sourceStr');
	obj.replaceStr=$F('replaceStr');
	obj.opUser="<%=LOGIN_ID%>";
	obj.opIp="<%=request.getRemoteAddr()%>";
	obj.createDatetime=new Date();
    buffalo.remoteCall("contentFilterServiceAjaxService.save",[obj], function(reply) {
        ajaxSubmit(reply.getResult(),null,"close");	
    });
}

function validateForm(form)
{
   	if(!sl_checkChoice(form.filterType,"过滤类型")) return false;
    if(!sl_check(form.sourceStr,"需要替换的内容",100,1)) return false;
    if(!sl_check(form.replaceStr,"替换后的内容",100,1)) return false;    
    return sl_confirmUpdate();
}



</script>
</HEAD>
<BODY leftMargin=0 topMargin=0 rightmargin="0" bottommargin="0" onkeydown="javascript:chachEsc(window.event.keyCode)">
<form name="theform" method="post" action="content_filter_new.jsp">
						<table border="0" width="100%" cellspacing="0" cellpadding="0">
							<tr>
								<td><img border="0" src="${pageContext.request.contextPath}/club/admin/images/config.gif" align="absbottom"><font color="#215dc6"><b>新建内容过滤</b></font></td>
							</tr>
							<tr>
								<td>
								<hr noshade color="#808080" size="1">
								</td>
							</tr>
						</table>
						<table border="0" width="100%" cellspacing="3">								
							<tr>
								<td width="46%" align="right">过滤类型:</td>
								<td width="49%">
								<select size="1" name="filterType" id="filterType" onkeydown="javascript:nextKeyPress(this)">
									<%=Arguments.getContentFilterTypeOptions(0)%>
								</select>
								</td>
							</tr>													
							<tr>
								<td width="46%" align="right">需要替换的内容:</td>
								<td width="49%"><input type="text" name="sourceStr" id="sourceStr" onkeydown="javascript:nextKeyPress(this)" size="20"></td>
							</tr>	
							<tr>
								<td width="46%" align="right">替换后的内容:</td>
								<td width="49%"><input type="text" name="replaceStr" id="replaceStr" onkeydown="javascript:nextKeyPress(this)" size="20"></td>
							</tr>																																				
						</table>
						<table border="0" width="100%">
							<tr>
								<td align="right">
								<button class="btn" accessKey=s id="btnSave" name="btnSave" onclick="javascript:doSubmit();">保存(<u>S</u>)</button>
								&nbsp;&nbsp;
								<button class="btn" accessKey=c id="btnCancel" name="btnCancel" onclick="javascript:window.returnValue=null;window.close();">取消(<u>C</u>)</button>
								&nbsp;&nbsp;								
								</td>
							</tr>
						</table>
</form>
</BODY>
</HTML>

